package la.bbs558.entity.enums;

import lombok.Getter;

/**
 * @author: Shanks
 * @date: 2024/1/19 10:22
 * @desc:
 */
@Getter
public enum ClassIdType {

    ALL(-1L, "全部"),
    ESSENCE(-2L, "精华"),
    TOP(-3L, "置顶"),
    END(-4L, "已结束"),
    ;

    private final Long id;
    private final String name;

    ClassIdType(Long id, String name) {
        this.id = id;
        this.name = name;
    }

    public static ClassIdType getById(Long id) {
        for (ClassIdType value : ClassIdType.values()) {
            if (value.getId().equals(id)) {
                return value;
            }
        }
        return null;
    }
}
